package com.zbf.tspring.springEvent;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author: LCG
 * @Date: 2022-04-16 11:20:38
 * @description: 监听事件的到来并通过Component 注册监听器到Spring容器
 **/
@Component
public class MyApplicationListener implements ApplicationListener<MyEvent> {
    @Override
    public void onApplicationEvent(MyEvent myEvent) {
        System.out.println("===========>监听到有时间进来====》"+myEvent.getSource());
    }
}
